home *** CD-ROM | disk | FTP | other *** search
/ Merciful 4 / Merciful - Disc 4.iso / rexx / x-tool.pprx < prev    next >
Text File  |  1996-11-01  |  1KB  |  65 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1996 Cloanto Italia srl */
  2.  
  3. /* $VER: XTool.pprx 1.0 */
  4.  
  5. /** ENG
  6.  This is a example of a "tool script". This tool, entirely created in
  7.  Rexx, draws an "X" on the image, using the current brush, foreground
  8.  color and paint mode.
  9. */
  10.  
  11. /** DEU
  12.  Dies ist ein Beispiel für ein "Tool Skript". Dieses ausschließlich
  13.  in Rexx geschriebene Tool zeichnet ein "X" auf das Bild, wobei die
  14.  aktuellen Einstellungen für Brush, Vordergrundfarbe und Malmodus
  15.  verwendet werden.
  16. */
  17.  
  18. IF ARG(1, EXISTS) THEN
  19.     PARSE ARG PPPORT button x0 y0 .
  20. ELSE
  21.     EXIT 0  /* macro execution only */
  22.  
  23. ADDRESS VALUE PPPORT
  24. OPTIONS RESULTS
  25. OPTIONS FAILAT 10000
  26.  
  27. Get 'LANG'
  28. IF RESULT = 1 THEN DO        /* Deutsch */
  29.     txt_err_oldclient = 'Für dieses Skript_ist eine neuere Version_von Personal Paint erforderlich'
  30. END
  31. ELSE IF RESULT = 2 THEN        /* Italiano */
  32.     txt_err_oldclient = 'Questa procedura richiede_una versione più recente_di Personal Paint'
  33. ELSE                /* English */
  34.     txt_err_oldclient = 'This script requires a newer_version of Personal Paint'
  35.  
  36. Version 'REXX'
  37. IF RESULT < 7 THEN DO
  38.     RequestNotify 'PROMPT "'txt_err_oldclient'"'
  39.     EXIT 10
  40. END
  41.  
  42. prev_xp = x0
  43. prev_yp = y0
  44. drawn = 0
  45.  
  46. DO FOREVER
  47.     GetMousePosition
  48.     PARSE VAR RESULT xp yp .
  49.  
  50.     IF xp ~= prev_xp | yp ~= prev_yp | ~drawn THEN DO
  51.         IF drawn THEN
  52.             Undo 2
  53.         DrawLine x0 y0 xp yp
  54.         DrawLine xp y0 x0 yp
  55.         prev_xp = xp
  56.         prev_yp = yp
  57.         drawn = 1
  58.     END
  59.     ELSE WaitForEvent
  60.  
  61.     GetMouseButton
  62.     IF RESULT ~= button THEN
  63.         LEAVE
  64. END
  65.